{% extends 'base.html' %}
{% block title %}问题处理{% endblock %}
{% block main_content %}
    <div class="row">
        <div class="panel panel-default">
            <div class="panel-heading">
            </div>
            <div class="panel-body ">
                <form action="{{url_for('save_feedback')}}" method="post" class="form-horizontal">
                    <div class="form-group">
                        <label for="subject" class="control-label col-md-2 " >主题</label>
                        <div class="col-md-6" >
                            <input type="text" value="{{ items.Subject }}" class="form-control" id="subject" name="subject">
{#      不显示 传递 rowid       #}
                            <input type="hidden"  value="{{ items.rowid }}" class="form-control" id="rowid" name="rowid">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="category" class="control-label col-md-2">分类</label>
                        <div class="col-md-2">
                            <select name="category" id="category" class="form-control">
                                {% for category in categorys %}
{# 判断选择项 {{'selected=selected' if category[0]== items[1] }} value="{{ category[0] }}" #}
                                    <option {{'selected=selected' if category.rowid == items.CategoryID }} value="{{ category.rowid }}">{{category.CategoryName}}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="username" class="control-label col-md-2 " >姓名</label>
                        <div class="col-md-2" >
                            <input type="text" value="{{ items.UserName }}" class="form-control" id="username" name="username">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="email" class="control-label col-md-2 " >邮箱</label>
                        <div class="col-md-6" >
                            <input type="text" value="{{ items.Email }}" class="form-control" id="email" name="email">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="image" class="control-label col-md-2 " >图片</label>
                        <div class="col-md-6" >
                            <img src="{{ url_for('rend_file',filename=items.Image) }}" alt="{{ items.Subject }}">
                            <input type="file"  id="image" name="image">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="body" class="control-label col-md-2 ">问题描述</label>
                        <div class="col-md-6">
                            <textarea class="form-control"  cols="30" rows="10" id="body" name="body">{{ items.Body }}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="reply" class="control-label col-md-2 ">情况回复</label>
                        <div class="col-md-6">
                            <textarea class="form-control" cols="30" rows="10" id="reply" name="reply">{{ items.Reply }}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="isprocessed" class="control-label col-md-2">处理</label>
                        <div class="col-md-6">
                            <input type="checkbox" {{ 'checked=checked' if items.State =='1' else '' }} name="isprocessed" id="isprocessed">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="releasetime" class="control-label col-md-2 " >发布时间</label>
                        <div class="col-md-6" >
                            <input type="text" value="{{ items.RelerseTime }}" class="form-control" id="releasetime" name="releasetime">
                        </div>
                    </div>
                    <div class="col-md-offset-3">
                        <input type="submit" class="btn btn-primary" value="提交">
                        <input type="reset" class="btn btn-default" value="重置">
                        <a href="{{ url_for('feedback_list') }}" class="btn btn-default">返回列表</a>
                    </div>

                </form>
            </div>
            <div class="panel-footer  "></div>
        </div>

    </div>
{% endblock %}
